<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>05_ES6常用语法</title>
  </head>
  <body>
    <script>
      /* 
      1. let与const
      2. 解构赋值

      3. 字符串扩展: 模板字符串
      4. 对象扩展: 属性简写与方法简写, 扩展符
      5. 数组扩展: 扩展符, find/findIndex/includes
      6. 函数扩展: 箭头函数 / 参数默认值 / 剩余参数

      7. 类语法: class / constructor / extends / super / static
      8. 异步语法: Promise / async & await
      9. 模块化语法: export / default / import
      */

      /*  1. let与const */
      const a1 = {m: 1}
      // a1 = {} // error
      a1.m = 2 // 不问题
      let a2 = {m: 3}
      a2 = {}

      /* 2. 解构赋值 */
      function fn({name, age}) { // 形参解构
        
        return {
          m: 3,
          n: ['abc', 123]
        }
      }
      const {n, m} = fn({name: 'tom', age: 12})
      const [x, y] = n



    </script>
  </body>
</html>
